package com.lifesaftypower.adapter;

import java.util.List;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;

import com.lifesaftypower.activity.R;

public class SolutionAdapter extends ArrayAdapter<String> {

	public SolutionAdapter(Context context, int textViewResourceId,
			List<String> objects) {
		super(context, textViewResourceId, objects);

	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		
		View v = convertView;

		if (v == null) {
			LayoutInflater vi = (LayoutInflater) getContext().getSystemService(
					Context.LAYOUT_INFLATER_SERVICE);
			v = vi.inflate(R.layout.solution_list_item, null);
		}
		
		String sol = getItem(position);
		
		if (sol != null) {
			TextView solName = (TextView) v
					.findViewById(R.id.tvName);

			if (solName != null) {
				solName.setText(sol);
			}
			

		}
		return v;
	}

}
